package com.itbac.mybatisplusspringbootdemo.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.itbac.mybatisplusspringbootdemo.handler.MyMetaObjectHandler;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 用户表
 *
 * @author: BacHe
 * @email: 1218585258@qq.com
 * @Date: 2021/8/29 13:43
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true) //链式编程
@TableName("tb_user")  //mybatisplus 中指定表名
public class User implements Serializable{
    @TableId(type = IdType.AUTO)
    private Long id;
    private String userName;
    /**
     * 不查询密码,fill插入数据时填充
     * @see MyMetaObjectHandler
     */
    @TableField(select = false,fill = FieldFill.INSERT)
    private String password;

    private String name;
    private String age;
    private String email;
    //逻辑删除。1代表删除,0代表未删除
    @TableLogic
    private int deleted;
}
